﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace OpenComposite.Base
{
	public static class XmlHelper
	{
		/// <summary>
		/// Appends a new XML element. Returns passed XmlNode
		/// </summary>
		/// <param name="xd">The document context of the new node.</param>
		/// <param name="xn">The XmlNode.</param>
		/// <param name="name">The name.</param>
		/// <param name="value">The value.</param>
		/// <returns>The passed in XmlNode</returns>
		public static XmlNode AppendXmlElement(XmlDocument xd, XmlNode xn, string name, string value)
		{
			XmlElement xe = xd.CreateElement(name);
			xe.AppendChild(xd.CreateTextNode(value));
			xn.AppendChild(xe);
			return xn;
		}
	}
}
